@extends('admin.master')
<script src="/js/admin/remindersFlux.js"></script>
@section('title', '剩余流量提醒')
	
@section('firstItem')
				<span>剩余流量提醒</span>
				<input class="a_indexbg" type="hidden" value="reminders" />
@stop
@section('searchList')
@parent
		<a class="queryBoxBtn fluxQueryBtn">搜索</a>
				<div><input class="chargeQueryInput" type="text" placeholder="输入用户名或设备编号" value="{{ $condition }}" /></div>
@stop		
@section('dataTables')
@parent
			<table class="filterWarn dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>设备编号</td>
						<td>用户名</td>
						<td style="width:5%">剩余流量(L)</td>
						<td>剩余天数(D)</td>
						<td>购买模式</td>
						<td>记录时间</td>
						<td>水机用户</td>
						<td>用户电话</td>
						<td>是否已提醒用户</td>
					</tr>
				</thead>
				<tbody>
					@for($i=0, $remindersCount=count($remind_records); $i<$remindersCount; $i++)
					<tr >
						<td>{{ $i+1 }}</td>
						<td class="devicecodeVal">{{ $remind_records[$i]->device->code }}</td>
						<td>{{ $remind_records[$i]->device->installInfo->customer_name or '尚未录入' }}</td>
						@if($remind_records[$i]->residual_flow <= 100)
						<td class="warnBg">
						@else
						<td>
						@endif
						{{ $remind_records[$i]->residual_flow or '/'}}</td>
						@if($remind_records[$i]->time_limit <= 20)
						<td class="warnBg">
						@else
						<td>
						@endif
						{{ $remind_records[$i]->time_limit or '/' }}</td>
						@if($remind_records[$i]->recharge_mode == 1)
						<td>套餐模式
						@else<td>计量模式
						@endif
						</td>
						<td>{{ $remind_records[$i]->created_at }}</td>
						<td>
							@for($j=0, $userInfoCount=count($remind_records[$i]->device->userInfos);$j<$userInfoCount; $j++)
									{{ $remind_records[$i]->device->userInfos[$j]->name }}
								@if($j<$userInfoCount-1)
									、
								@endif
							@endfor
						</td>
						<td>{{ $remind_records[$i]->device->installInfo->phone or '尚未录入' }}</td>
						<td><input type="hidden" value="{{ $remind_records[$i]->id }}" />
						@if($remind_records[$i]->flow_status)
						<span class="checkedBox checkedBoxBg"></span>
						@else
						<span class="checkedBox"></span>
						@endif
						</td>
					</tr>
					@endfor
				</tbody>
			</table>
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
	<?php $queryParam = empty($condition)? []: ['condition' => $condition]; ?>
	{!! $remind_records->appends($queryParam)->render() !!}
</ul>
@stop
@section('infor_promit')
@parent
	<div class="checkHintBox">
		<div>是否已与水机用户电话联系，说明水机目前的剩余流量状态</div>
		<label class="labelBox remindersLabelBox"></label>
		<div class="btnBox">
			<a class="fluxnoBtn">取消</a>
			<a class="fluxYesBtn">确定</a>
		</div>
	</div>
@stop
